package r6.powtorka;

import java.text.DateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Random;

public class TablicaIntow {

	private Date[] daty = new Date[1000];
	Random los = new Random();

	private final int[] licznik = new int[1];

	public void makeSortedTable() {
		DateFormat dateFormatter = DateFormat.getDateInstance();
		for (int i = 0; i < daty.length; i++) {
			daty[i] = new GregorianCalendar(los.nextInt(42) + 1970,
					los.nextInt(11), los.nextInt(28), los.nextInt(24),
					los.nextInt(59), los.nextInt(59)).getTime();
			System.out.println(dateFormatter.format(daty[i]));
		}
		System.out.println();

		Arrays.sort(daty);
		for (Date e : daty)
			System.out.println(e);

		System.out.println();
		System.out.println(licznik[0]);
	}

}
